function chooseAll(check) {
	var chooseAll = document.getElementsByName("selected_id");
	if(null == chooseAll) return;
	var len = chooseAll.length;
	for(var i = 0; i < len; i++){
		var element = chooseAll[i];
      if(element.type == 'checkbox') {
			element.checked = check.checked?true:false;
		}
	}
}


function actionDelete(form) {
	var chooseAll = document.getElementsByName("selected_id");
	if(null == chooseAll) return;
	var haschoose=0;
	var len = chooseAll.length;
	for(var i = 0; i < len; i++){
		var element = chooseAll[i];
      if(element.type == 'checkbox'&&element.checked) {
			haschoose=haschoose+1;
		}
	}
	if(haschoose==0)
	{
	alert("请选择要删除的记录！");
	return;
	}
	else
	{
	
		if(confirm("是否确定删除所选项？")){
	 	document.forms[form].submit();
	 }
	
	}
	
}

function actionUpdate(form) {
	var chooseAll = document.getElementsByName("selected_id");
	if(null == chooseAll) return;
	var haschoose=0;
	var len = chooseAll.length;
	for(var i = 0; i < len; i++){
		var element = chooseAll[i];
      if(element.type == 'checkbox'&&element.checked) {
			haschoose=haschoose+1;
		}
	}
	if(haschoose==0)
	{
	alert("请选择记录！");
	return;
	}
	else
	{
	if(haschoose>1){
	alert("只能选择一条记录！");
	return;
	}
	else
	{
	 document.forms[form].submit();
	
	}
	}

}

